part of '../events.dart';

/// The [TouchEvent] class lets you handle events on devices that detect user
/// contact with the device (such as a finger on a touch screen).
///
/// You have to opt-in for touch events by setting the InputEventMode
/// to `TouchOnly` or `MouseAndTouch` in the stage options like this:
///
///     StageXL.stageOptions.inputEventMode = InputEventMode.MouseAndTouch;

class TouchEvent extends InputEvent {
  static const String TOUCH_BEGIN = 'touchBegin';
  static const String TOUCH_END = 'touchEnd';
  static const String TOUCH_CANCEL = 'touchCancel';
  static const String TOUCH_MOVE = 'touchMove';

  static const String TOUCH_OVER = 'touchOver';
  static const String TOUCH_OUT = 'touchOut';

  static const String TOUCH_ROLL_OUT = 'touchRollOut';
  static const String TOUCH_ROLL_OVER = 'touchRollOver';
  static const String TOUCH_TAP = 'touchTap';

  //---------------------------------------------------------------------------

  /// A unique identification number assigned to the touch point.

  final int touchPointID;

  /// Indicates whether the first point of contact is mapped to mouse events.

  final bool isPrimaryTouchPoint;

  /// Creates a new [TouchEvent].

  TouchEvent(
      super.type,
      super.bubbles,
      super.localX,
      super.localY,
      super.stageX,
      super.stageY,
      super.altKey,
      super.ctrlKey,
      super.shiftKey,
      this.touchPointID,
      this.isPrimaryTouchPoint);
}
